package cate.game.role.pvp.throne.msg;

import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBTB;
import cate.game.role.RoleSnapshot;
import cate.game.role.pvp.throne.core.TrialOpponent;
import easy.java.dev.note.NoteField;

import java.util.HashMap;
import java.util.Map;

@ClientMsg(title = "选拔赛获取对手 の 返回")
public class TBTrialOpponentResp implements MsgOutput {

    @NoteField("上次刷新时间")
    public long lastRefreshTime;

    @NoteField(value = "对手数据",detail = "Map<等级，对手>")
    public Map<Integer, RoleSnapshot> snapshotMap = new HashMap<>();

    public TBTrialOpponentResp(long lastRefreshTime, Map<Integer, TrialOpponent> opponents) {
        this.lastRefreshTime = lastRefreshTime;
        for (TrialOpponent value : opponents.values()) {
            snapshotMap.put(value.level, value.playSide.snapshot);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTB.OPPONENT_RESP;
    }

    public TBTrialOpponentResp() {
    }
}
